package cn.itcast.www.jspservletTest;

import java.io.IOException;

import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.JspFragment;
import javax.servlet.jsp.tagext.SimpleTagSupport;
//
public class WelcomeSimpleTag extends SimpleTagSupport {
	private String name;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public void doTag() throws JspException, IOException {
		JspFragment body = this.getJspBody();
		JspContext jspCtx = this.getJspContext();
		JspWriter out = jspCtx.getOut();
		out.print(name);
		out.print(",");
		//将标签体的内容输出到浏览器
		body.invoke(null);
	}	
}
